package pers.lmd.controller;

import cn.hutool.core.lang.tree.Tree;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.lmd.common.constant.ResultEnum;
import pers.lmd.service.IMenuService;
import pers.lmd.common.utils.ResultUtil;
import pers.lmd.domain.R;

import java.util.List;

/**
 * @Author lmd
 * @Date 2023/4/11 23:21
 */
@RequiredArgsConstructor
@RestController
@Tag(name="菜单控制器")
@RequestMapping("/system")
public class MenuController {

    private final IMenuService IMenuService;
    @GetMapping("/menu")
    public R<List<Tree<Integer>>> getMenu(){
        return ResultUtil.success(ResultEnum.SUCCESS, IMenuService.getMenu()) ;
    }
}
